#include <string>
#include <vector>
#include <iostream>

using namespace std;

int FirstNotRepeatingChar(string str) {
	if (str.length() == 0)
		return -1;
	int hash[256] = { 0 };
	for (auto c : str)
		hash[c]++;
	for (int i = 0; i < str.length(); ++i)
		if (1 == hash[str[i]])
			return i;

	return -1;
}

//int main()
//{
//	cout << FirstNotRepeatingChar("google");
//
//	system("pause");
//	return 0;
//}